def __init__(self,argument,...,argument=value): Statements ----------
class circle: def __init__(this,n=1): this.__r=n def area(this): a=3.14*this.__r**2 print("Area is ",a) a=circle(5) a.area() b=circle() b.area()
Area is 78.5 Area is 3.14
class Time: def __init__(self,h=0,m=0): self.hours=h self.mins=m def display(self): print(self.hours,":",self.mins) a=Time(2,45) b=Time(2) c=Time() a.display() b.display() c.display()
2:45 2:0 0:0